import requests
import parsel

url = 'https://sh.lianjia.com/ershoufang/'
headers = {
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
}

reponse = requests.get(url=url,headers=headers)

selector = parsel.Selector(reponse.text)

lis = selector.css('.sellListContent li')

for li in lis:
    title = li.css(' .title a::text').get()
    if title:
        address_list = li.css('.flood a::text').getall()
        address = '-'.join(address_list)
        hourse_info = li.css('.houseInfo::text').get().split('|')
        #面积
        acreage = hourse_info[0] #面积
        print(acreage)